/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.jasoet.model;

import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Deny Prasetyo
 */
@Entity
@Table
public class Kategori implements java.io.Serializable {

    private static final long serialVersionUID = -496676157809851089L;
    @Id
    @Column(name = "kode", length = 15, nullable = false, unique = true)
    private String kode;
    @Column(name = "keterangan", length = 50, nullable = false)
    private String keterangan;
    @OneToMany(mappedBy = "kategori", cascade = CascadeType.ALL)
    private List<SubKategori> listSubKategori;

    public Kategori() {
    }

    public Kategori(String kode, String keterangan) {
        this.kode = kode;
        this.keterangan = keterangan;
    }

    public String getKode() {
        return kode;
    }

    public void setKode(String kode) {
        this.kode = kode;
    }

    public String getKeterangan() {
        return keterangan;
    }

    public void setKeterangan(String keterangan) {
        this.keterangan = keterangan;
    }

    public List<SubKategori> getListSubKategori() {
        return listSubKategori;
    }

    public void setListSubKategori(List<SubKategori> listSubKategori) {
        this.listSubKategori = listSubKategori;
    }
}
